package com.gxa.www.cl.controller;

import com.gxa.www.cl.service.InboundStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class InboundStatisticController {

    @Autowired
    private InboundStatisticService inboundStatisticService;

    @GetMapping("/api/getMedicalData")
    public Map<String, Object> getData(
            @RequestParam(required = false) String category,
            @RequestParam(required = false) String name,
            @RequestParam(required = false) String date) {
        List<Map<String, Object>> data = inboundStatisticService.getInboundStatistics(category, name, date);
        Map<String, Object> response = new HashMap<>();
        response.put("code", 0);
        response.put("data", data);
        return response;
    }
}